import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'

// 布局容器
import Layout from '../pages/Layout'
// 登录组件
import Login from '../pages/Login'
import Dashboard from '../pages/Dashboard'
import Employees from '../pages/Employees'
// import EmployeesDetail from '../pages/Employees/detail'
import Permission from '../pages/Permission'
import Departments from '../pages/Departments'
import Setting from '../pages/Setting'
import Salarys from '../pages/Salarys'
import Approvals from '../pages/Approvals'
import Attendances from '../pages/Attendances'
import Social from '../pages/Social'
// // 导入 404 页面
import PageError from '../pages/404'

const BaseRouter = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Layout />}>
          <Route index element={<Navigate to="/dashboard" />}></Route>
          <Route path="dashboard" element={<Dashboard />}></Route>
          <Route path="employees" element={<Employees />}></Route>
          <Route path="permissions" element={<Permission />}></Route>
          <Route path="departments" element={<Departments />}></Route>
          <Route path="settings" element={<Setting />}></Route>
          <Route path="salarys" element={<Salarys />}></Route>
          <Route path="approvals" element={<Approvals />}></Route>
          <Route path="attendances" element={<Attendances />}></Route>
          <Route path="socials" element={<Social />}></Route>
          <Route path="*" element={<PageError />}></Route>
        </Route>
        <Route path="/login" element={<Login />}></Route>
      </Routes>
    </BrowserRouter>
  )
}

export default BaseRouter
